package test.yunpay.com.mvpproject.modelImpl;

import android.os.Handler;
import android.os.Looper;
import android.os.Message;

import test.yunpay.com.mvpproject.OnResultComeBack;
import test.yunpay.com.mvpproject.model.IMainNetMethod;
import test.yunpay.com.mvpproject.util.LogUtil;

/**
 * Created by Administrator on 2018/5/4 0004.
 */

public class MainNetMethodImpl implements IMainNetMethod {

    private Handler mHandler = new Handler(Looper.getMainLooper()) {
        @Override
        public void handleMessage(Message msg) {
            super.handleMessage(msg);

            OnResultComeBack comeBack = (OnResultComeBack) msg.obj;
            comeBack.success();
        }
    };

    @Override
    public void getDetail(OnResultComeBack comeBack) {
        LogUtil.e("MainNetMethod----getDetail");
        Message message = mHandler.obtainMessage();
        message.obj = comeBack;
        mHandler.sendMessageDelayed(message, 2000);
    }
}
